{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-body">
        <blockquote class="layui-elem-quote layui-text">
            会员分析：<span class="text-danger"></span><span class="text-danger"></span>
        </blockquote>
        <div id="container" style="width: 80%;height:600px;"></div>
    </div>
</div>
{/block}
{block name="js"}
{js href="__JS__/echarts.min.js,__JS__/wonderland.js" /}
<script type="text/javascript">
setTimeout(getViews,300);
setInterval(getViews,60000);
function getViews()
{
    $.post('get_user_stats_info.html',function(res){
        var myChart = echarts.init(document.getElementById('container'), 'wonderland');
        var res = $.parseJSON(res);
        myChart.setOption({
            title: [{
                text: '会员数据分析',
                left: 'center',
            }, {
                subtext: '性别占比',
                left: '16.67%',
                top: '80%',
                textAlign: 'center'
            }, {
                subtext: '年龄占比',
                left: '50%',
                top: '80%',
                textAlign: 'center'
            }, {
                subtext: '信用值',
                left: '83.33%',
                top: '80%',
                textAlign: 'center'
            }],
            series: [{
                type: 'pie',
                radius: '60%',
                data: res[0],
                label: {
                    formatter: '{b}\n{c} 人'
                },
                left: 0,
                right: '66.6667%',
                top: 0,
                bottom: 0
            }, {
                type: 'pie',
                radius: '60%',
                data: res[1],
                label: {
                    formatter: '{b}\n{c} 人'
                },
                left: '33.3333%',
                right: '33.3333%',
                top: 0,
                bottom: 0
            }, {
                type: 'pie',
                radius: '60%',
                data: res[2],
                label: {
                    formatter: '{b}\n{c} 人',
                },
                left: '66.6667%',
                right: 0,
                top: 0,
                bottom: 0
            }]
        });
    });
}
</script>
{/block}